<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');
?>

<h1>Delete Building</h1>

<?php

$building_id = mysql_real_escape_string(strip_tags($_POST['id']));

$get_building_data = mysql_query("SELECT * FROM buildings WHERE id = $building_id");
$building_name = mysql_result($get_building_data,0,'building_name');

$query = "DELETE FROM buildings WHERE id='$building_id'";
$result = mysql_query($query);

if ($result)
{
	echo "<b>$building_name</b> has been successfully deleted!";
	echo "<br />";
}
else
{
	echo "<b>$building_name</b> was NOT able to be deleted at this time!";
	echo "<br />";
}

//close
mysql_close();

?>

<p>
	<a href="index.php">&lt;&lt; Back to Buildings Portal</a><br />
</p>

<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>